import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      name: 'home',
      component: HomeView,
    },
      {
        path: '/about',
        name: 'about',
        component: () => import('../views/AboutView.vue'),
      },
      {
        path: '/test',
        name: 'test',
        component: () => import('../views/TestView.vue'),
      },
    {
      path: '/',
      name: 'login',
      component: () => import('../views/User/UserLogin.vue'),
    },
    {
      path: '/index',
      name: 'index',
      component: () => import('../views/IndexView.vue'),
      redirect: '/userlist',
      children:[
        {
          path: '/userlist',
          name: 'userlist',
          component: () => import('../views/User/UserList.vue'),
        },
        {
          path: '/rolelist',
          name: 'rolelist',
          component: () => import('../views/User/RoleList.vue'),
        },
        {
          path: '/permissionlist',
          name: 'permissionlist',
          component: () => import('../views/User/PermissionList.vue'),
        },
        {
          path: '/deptlist',
          name: 'deptlist',
          component: () => import('../views/Department/DeptList.vue'),
        },
        {
          path: '/roomlist',
          name: 'roomlist',
          component: () => import('../views/MeetingRoom/RoomView.vue'),
        },
        {
          path: '/appiontlist',
          name: 'appiontlist',
          component: () => import('../views/MeetingRoom/AppiontMent.vue'),
        },
        {
          path: '/meetapproval',
          name: 'meetapproval',
          component: () => import('../views/MeetingRoom/MeetApproval.vue'),
        },
      ]
    },
  ],
})

export default router
